package ead.cs.service;

import ead.cs.service.config.SMSConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class SmsSender {

    @Autowired
    private RestTemplate restTemplate;
    @Autowired
    private SMSConfig smsConfig;

    public void sendSms(String to, String message) {
        String url = smsConfig.getSmsHost() + "receive/sms/"+ to + "/" + message;
        String response = restTemplate.getForObject(url, String.class);
    }

}
